<?php
	/* Description: This file is used to display all sub sub categories for a particular sub category */
	#########IncludeFiles####################################################################################
	require_once '../inc/config.php';
	require_once "../inc/bootstrape.php";
	require_once _SITE_PATH_.'classes/Vendor/Vendor.php';
	require_once _SITE_PATH_.'classes/Category/Category.php';
	require_once _SITE_PATH_.'classes/CommonUtility/CommonUtility.php';

	$action = trim($_REQUEST['action']);
	$id = trim($_REQUEST['id']);
	$category_id = isset($_REQUEST['category_id'])?$_REQUEST['category_id']:'';
	
	switch($action){
		case 'active':
			$parms['status'] = '1';
			$condition['id'] = $id;
			$row = CommonUtility::updateData($parms,$table='category',$condition);
			$errMsg = "1095" ;
		break;
		case 'deactive':
			$parms['status'] = '0';
			$condition['id'] = $id;
			$row = CommonUtility::updateData($parms,$table='category',$condition);
			$errMsg = "1096" ;
		break;
		case 'delete':
			$parms['status'] = '2';
			$condition['id'] = $id;
			$row = CommonUtility::updateData($parms,$table='category',$condition);
			$errMsg = "1097" ;
		break;
	}
	if( $errMsg ){
		header("Location: subsubcategory_mng.php?msg=".$errMsg."&category_id=".$category_id);
		exit;
	}
	
	$subcategories = array();
	$subcategories = Category::getSubCategories();
	
	$subsubcategories = array();
	$subsubcategories = Category::getSubSubCategories($category_id);

	$errMsg = $_GET['msg'];
	$_tplName = 'category/subsubcategory_mng.tpl';
	$_title = 'Sub-Sub-Category Management';
	require_once _ADMIN_TPL_MAIN_;
?>